import { toggle } from "./toggle_aside_nav.js";
export default function bind(logo_btn="#app_body_slide_logo li",nav="#app_body_slide_nav ul") {
    let btns = document.querySelectorAll(logo_btn);
    let navs = document.querySelectorAll(nav);
    btns.forEach((v,k)=>{
        v.addEventListener("click",function(event){
            btns.forEach((v1,k1)=>{
                v1.classList.remove("active");
            })
            v.classList.add("active");
            // console.log(v.attributes.getNamedItem("data-nav"));
            let nav=(v as HTMLElement).dataset.nav;
            navs.forEach((v)=>{
                v.classList.remove("active")
            });
            for (const v of navs) {
                if((v as HTMLElement).dataset.nav==nav){
                    v.classList.add("active")
                    toggle(true);
                    break;
                }
            }
           
            console.log((v as HTMLElement).dataset.nav);
            
        })
        
    })
  
}